using System.Text.Json.Serialization;

namespace Vin.Extension.Win32.Command.Node;


public class NodeGroup : IJsonOnDeserialized
{
    public string Id { get; set; } = null!;
    
    /// <summary>
    /// 输入端口对应的id
    /// </summary>
    public Dictionary<int, string> InputPort { get; set; } = new();

    public int Port { get; set; }

    public NodeGroup? Next { get; set; }
    
    /// <summary>
    /// 输入节点是否已经输入
    /// </summary>
    public Dictionary<int, bool> InputNodeDict { get; set; } = new();

    public void OnDeserialized()
    {
        for (int i = 0; i < InputPort.Count + 1; i++)
        {
            InputNodeDict.Add(i, false);
        }

        InputNodeDict[0] = true;
    }
}